package com.xiaoxie.quartz.util;

import org.quartz.Job;

public class JobClassCheck {

    /**
     * 判断给定的类全名是否是Job类
     * @param className 全类名
     * @return
     */
    public static boolean isJobClass(String className) {
        try {
            Class<?> clazz = Class.forName(className);
            return Job.class.isAssignableFrom(clazz);
        } catch (ClassNotFoundException e) {
            return false;
        }
    }

    /**
     * 判断给定的类是否是Job类
     * @param clazz 待检测的类对象
     * @return
     */
    public static boolean isJobClass(Class clazz) {
        return Job.class.isAssignableFrom(clazz);
    }
}
